<?php
/* @var $this UserController */
/* @var $model User */

$this->breadcrumbs=array(
	Yii::t('user_messages','user.manage'),
);

$this->menu=array(
	array('label'=>Yii::t('user_messages','user.viewAll'), 'url'=>array('index')),
	array('label'=>Yii::t('user_messages','user.create'), 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#user-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('user_messages','user.manage')?></h1>

<br/>

<?php echo CHtml::link(Yii::t('user_messages','advanced.search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none;" >
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'user-grid',
	'type' => TbHtml::GRID_TYPE_STRIPED,
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'username',
		'email',
		 array(           
                'name'=>'role_id',
				'value'=>'$data->roleString',
				'filter'=>false,
                  ),   
				 array(           
                'name'=>'isactive',
				'value'=>'$data->statusString',
				'filter'=>false,
                  ),
		array(
		'class'=>'bootstrap.widgets.TbButtonColumn',
		),
	),
)); ?>
